from enum import Enum


class EventTypeEnum(Enum):

    EVENT_TICK = "Tick"
    EVENT_INSTRUCTION = "Instruction"
    EVENT_TRADE = "Trade"
    EVENT_ORDER = "Order"
    EVENT_POSITION = "Position"
    EVENT_ACCOUNT = "Account"
    EVENT_QUOTE = "Quote"
    EVENT_CONTRACT = "Contract"
    EVENT_LOG = "Log"
    EVENT_TIMER = "Timer"
    EVENT_SYS_TERMINATE = "SysTerminate" 

    EVENT_INSTRUCTION_ORDER = "InstructOrder"
    EVENT_INSTRUCTION_CANCEL = "InstructCancel"

def get_event_type_enum_by_value(value: str) -> EventTypeEnum | None:
    for item in EventTypeEnum:
        if item.value == value:
            return item
    return None